package cn.wizzer.app.user.modules.models.enums;

import lombok.Getter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Getter
public enum ExchangeEnum {
    PAID("已付款", 1),
    CANCELED("已取消", -1),
    DELIVERY("已发货", 2),
    FINISHED("已完成", 3),
    ;
    final public String NAME;
    final public Integer VALUE;


    ExchangeEnum(String name, Integer val) {
        NAME = name;
        VALUE = val;
    }

    public static List toList() {
        List<Map<String, Object>> list = new ArrayList<>();
        for (ExchangeEnum exchangeEnum : ExchangeEnum.values()) {
            Map<String, Object> map = new HashMap<>();
            map.put("name", exchangeEnum.getNAME());
            map.put("val", exchangeEnum);
            list.add(map);
        }
        return list;
    }

}
